package com.icast.tools;

import android.util.Log;

import com.icast.interlayer.Interlayer;

public class LogCat {
	/**
	 * 单行最大输出字符数量
	 */
	private final static int SINGLE_LINE_MAX_SIZE = 100;
	private static String TAG = "ICastApi";

	public static void log(String veryLongString) {
		if (veryLongString == null) {
			veryLongString = "null";
		}
		for (int i = 0; i <= veryLongString.length() / SINGLE_LINE_MAX_SIZE; i++) {
			int start = i * SINGLE_LINE_MAX_SIZE;
			int end = (i + 1) * SINGLE_LINE_MAX_SIZE;
			end = end > veryLongString.length() ? veryLongString.length() : end;
			String logText = veryLongString.substring(start, end);
			Log.d(TAG, logText);
			Interlayer.log(logText);
		}
	}
}
